All Questions
7 questions
2votes
4answers
3kviews
I wrote a class with "init" method. Should I call it from other class methods? Or leave it to the object user? (Code Design)
I have a java class with an init method. It's different from the constructor. The constructor just initializes the variables/fields. The init method connects to a database and performs some ...
1vote
1answer
1kviews
Improving a try/catch
I'm a python programmer trying to get to grips with Java's inflexibility; I'm trying to parse a date from a string into a Calendar object private Calendar parsedDate ( String dateString ) throws ...
84votes
8answers
73kviews
Is modifying an incoming parameter an antipattern? [closed]
I am programming in Java, and I always make converters sort of like this: public OtherObject MyObject2OtherObject(MyObject mo){ ... Do the conversion return otherObject; } At the new ...
4votes
5answers
13kviews
Is it a good practice to wrap collection in Java? [closed]
I came across a snippet like this, and find it's over engineering. Is it a good practice? public class SchoolList extends ArrayList<School> { } public class School extends ArrayList<...
4votes
2answers
1kviews
When is it worthwhile to replace working mature code with frameworks+patterns
Intro/Question I fear that frameworks in many cases have become a fashion or trend and are being abused. In many ways people are sacrificing speed just because they want to keep up with every single ...
0votes
1answer
83views
How to record/store edits?
In many programs and web apps (stack exchange included) the program is able to backtrack what edits where made to the piece. My issue is similar: I want to be able to store a "timeline" of edits, ...
8votes
2answers
324views
Low coupling processing big quantities of data
Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure ...